﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;
class date {
public:
    date(int year=2024, int month=7, int day=23)
        :year(year),
        month(month),
        day(day)
    {}
	int operator-(const date& d) {
		if (this->year == d.year && this->month == d.month && this->day == d.day) {
			return 0;
		}
		int Ty = this->year;
		int Dy = d.year;
		bool flag = false;
		if (Ty < Dy) {
			flag = true;
			int tmp = Ty;
			Ty = Dy;
			Dy = tmp;
		}
		int ret = 0;
		while (Dy != Ty) {
			ret += 365;
			if ((Dy % 400 == 0) || (Dy % 100 != 0 && Dy % 4 == 0)) {
				ret++;
			}
			Dy++;
		}
		if (flag) {
			ret *= -1;
		}
		int Tday = this->getDay();
		int Dday = getDay(d.year, d.month, d.day);
		return ret + Tday - Dday+1;
	}
private:
    int year = 2024;
    int month = 7;
    int day = 24;
    static int getMonthDay(int year, int month) {
        static int days[] = { -1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
        if ((month == 2) && ((year % 400 == 0) || (year % 100 != 0 && year % 4 == 0))) {
            return 29;
        }
        return days[month];
    }
	static int getDay(int year, int month, int day) {
		int ret = 0;
		for (int i = 1; i < month; i++)
		{
			ret += getMonthDay(year, i);
		}
		ret += (day+1);
		return ret;
	}
	int getDay() {
		int ret = 0;
		for (int i = 1; i < month; i++)
		{
			ret += getMonthDay(year, i);
		}
		ret += (day +1);
		return ret;
	}
};

int main() {
	int d1, d2;
	while (cin >> d1 >> d2) {
		int day1 = d1 % 100;
		d1 /= 100;
		int month1 = d1 % 100;
		d1 /= 100;
		int year1 = d1;

		int day2 = d2 % 100;
		d2 /= 100;
		int month2 = d2 % 100;
		d2 /= 100;
		int year2 = d2;
		date dd1(year1, month1, day1);
		date dd2(year2, month2, day2);
		cout << dd2 - dd1 << endl;
	}
    return 0;
}